package 强化训练;

import java.util.Scanner;

public class day17统计字符出现的次数 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine().toLowerCase();
        String c = sc.next().toLowerCase();
        int count = 0;
        for (int i = 0; i < s.length(); i++) {
            if (c.equals(s.substring(i,i+1))) count++;
        }
        System.out.println(count);
    }
}
